package org.origin.ferret.system.model.entity;

import com.alibaba.fastjson2.annotation.JSONType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 系统客户端-实体类
 *
 * @author ferret
 * @version 2024-05-08
 */
@Data
@Accessors(chain = true)
@Table("oauth2_registered_client")
@Schema(description = "系统客户端-实体类")
@JSONType(ignores = {"clientSecret"})
@JsonIgnoreProperties(value = {"clientSecret"})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SysClientEntity {

    @Id(keyType = KeyType.None)
    @Schema(description = "主键")
    private String id;

    @Schema(description = "终端编码")
    private String clientId;

    @Schema(description = "创建时间")
    private Date clientIdIssuedAt;

    @Schema(description = "终端秘钥")
    private String clientSecret;

    @Schema(description = "过期时间")
    private Date clientSecretExpiresAt;

    @Schema(description = "终端名称")
    private String clientName;

    @Schema(description = "认证方式")
    private String clientAuthenticationMethods;

    @Schema(description = "授权模式")
    private String authorizationGrantTypes;

    @Schema(description = "定向地址")
    private String redirectUris;

    @Schema(description = "登出地址")
    private String postLogoutRedirectUris;

    @Schema(description = "访问范围")
    private String scopes;

    @Schema(description = "终端配置")
    private String clientSettings;

    @Schema(description = "令牌配置")
    private String tokenSettings;

}
